import { debounce } from 'common/utils.js'
import BackTop from 'components/content/backtop/BackTop.vue';
export const itemMixin = {
  components: {
    BackTop
  },
  data() {
    return {
      itemListener: null,
      isBackShow: false
    }
  },
  mounted() {
    const refresh = debounce(this.$refs.scrollRef.refresh, 300);
    this.itemListener = () => {
      refresh()
    }
    this.$bus.$on('goodsImageLoad', this.itemListener)
  },
  methods: {
    backTopClick() {
      this.$refs.scrollRef.scrollTo(0, 0, 1000)
    }
  },
}